package com.vmove.childtrain.db.entity;

import com.j256.ormlite.dao.ForeignCollection;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * 受训用户表
 */
@DatabaseTable(tableName = "child_user")
public class User 
{
	//表中各个字段的名称
	public static final String COLUMNNAME_ID = "id";
	public static final String COLUMNNAME_REAL_NAME = "username";
	public static final String COLUMNNAME_AGE = "age";
	public static final String COLUMNNAME_SEX = "sex";
	public static final String COLUMNNAME_HEIGHT = "height";
	public static final String COLUMNNAME_WEIGHT = "weight";
	private static final String COLUMNNAME_GROUP_ID = "teamid";

	@DatabaseField(generatedId = true,columnName = COLUMNNAME_ID)
	private int id;

	@DatabaseField(columnName = COLUMNNAME_REAL_NAME)
	private String username;

	@DatabaseField(columnName = COLUMNNAME_AGE)
	private int age;

	@DatabaseField
	private int birthYear;

	@DatabaseField
	private int birthMonth;


	/**
	 * 0 男  1女
	 */
	@DatabaseField(columnName = COLUMNNAME_SEX)
	private int sex;

	@DatabaseField(columnName = COLUMNNAME_HEIGHT)
	private int height;

	@DatabaseField(columnName = COLUMNNAME_WEIGHT)
	private int weight;

	@DatabaseField(columnName = COLUMNNAME_GROUP_ID,foreign = true,foreignColumnName ="id",
			foreignAutoRefresh = true)
	private Team team;

	public User()
	{
	}


	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public int getBirthYear() {
		return birthYear;
	}

	public void setBirthYear(int birthYear) {
		this.birthYear = birthYear;
	}

	public int getBirthMonth() {
		return birthMonth;
	}

	public void setBirthMonth(int birthMonth) {
		this.birthMonth = birthMonth;
	}

	@Override
	public String toString()
	{
		return "User [id=" + id + ", name=" +username;
	}

	


	
}
